<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
	<head>

		<title>日志列表</title>
		<link href="style/global.css" rel="stylesheet" type="text/css" />
		<link href="style/style.css" rel="stylesheet" type="text/css" />
		<sx:head />
		<style type="text/css">
<!--
#blogLayer {
	width: 1080;
	position: relative;
	width: 1080px;
	border: 1px #b4e1f8 solid;
	border-top: 0px;
}

#blogLayerRightList {
	width: 308px;
	height: 220px;
	z-index: 1;
	left: 12px;
	top: 20px;
	border: 1px #b4e1f8 solid;
}

#blogLayerLeft {
	margin-left: 0px;
	margin-top: 20px;
	border: 1px #b4e1f8 solid;
}

#blogLayerRight {
	width: auto;
	height: 263px;
	z-index: 2;
	left: 843px;
	margin-top: 20px;
	border: 1px #b4e1f8 solid;
}

#userhomelayer {
	width: 1280px;
	height: auto;
	z-index: 1;
}

#middle {
	width: 1080px;
	border: 1px #b4e1f8 solid;
	border-top: 0px;
}

#bottom1 {
	margin-top: 30px;
}
-->
</style>

	</head>
	<body>

		<div id="userhomelayer" align="center">
			<div id="top"><%@include file="top.jsp"%></div>
			<div id="blogLayer">
				<table>
					<tr>
						<td>
							<div id="blogLayerLeft">
								<div class=homeTitleMiddle align="left">
									&nbsp;&nbsp; 日志
								</div>
								<table width="655" height="205">

									<tr>
										<c:if test="${empty list}">还没写文章哦！
						        </c:if>
									</tr>
									<s:iterator value="blogList.pageList" id="blog">
										<tr>
											<td></td>
										</tr>
										<tr>
											<td colspan="4">
												<div align="left">
													<a
														href="/blog/browseBlog.action?articleId=${blog.articleId}"
														target="_blank">${blog.articleTitle}</a>
																<span class="browseBlog"> <c:if
											test="${blogUser.account==user.account}">
											<a
												href="/blog/browseToeditBlog.action?articleId=${blog.articleId}">编辑
											</a>
									
&nbsp;&nbsp;&nbsp;
									<a
												href="/blog/deleteBlog.action?articleId=${blog.articleId}&account=${blogUser.account}">删除</a>
										</c:if> </span>
												</div>
											</td>
										</tr>
										<tr>
											<td class="smallfont" colspan="4">
												${blog.articlePublishDate}
											</td>
										</tr>
										<tr>
											<td colspan="4" class="contentFont">											
												 ${blog.articleContent }
												
											</td>
										</tr>
										<tr>
											<td width="160" class="smallfont"
												style="border-bottom: 1px #ffffff dashed">
												类别：
												<s:if test="#blog.voice!=null&&#blog.voice!=''">  
								  语音日志
					            </s:if>
								<s:else>
					             普通日志
		                       </s:else>
											</td>
											<td width="139" height="35" class="smallfont"
												style="border-bottom: 1px #ffffff dashed">
												<a
													href="/blog/browseBlog.action?articleId=${blog.articleId}"
													target="_blank">阅读（${blog.visitNumber}）</a>
											</td>
											<td width="111" class="smallfont"
												style="border-bottom: 1px #ffffff dashed">
												<a
													href="/blog/browseBlog.action?articleId=${blog.articleId}"
													target="_blank">评论(${fn:length(blog.comments)})</a>
											</td>
											<td width="223" class="smallfont"
												style="border-bottom: 1px #ffffff dashed">
												<a
													href="/blog/browseBlog.action?articleId=${blog.articleId}"
													target="_blank">阅读全文</a>
											</td>
										</tr>
										<tr>
											<td colspan="4" style="border-bottom: 1px #ffffff dashed">
												&nbsp;
											</td>
										</tr>
									</s:iterator>
									<c:if test="${! empty blogList.pageList }">
										<tr>

											<td colspan="3" class="page">
												<span class="pagerFont"> <s:if
														test="!blogList.isFirstPage()">
														<sx:a id="link1"
															href="page.action?page=first&account=%{user.account }"
															targets="blogLayerLeft">首页 </sx:a>

														<sx:a id="link3"
															href="page.action?page=previous&account=%{user.account }"
															targets="blogLayerLeft">上一页 </sx:a>
													</s:if> 共 <s:property value="blogList.getPageCount()" /> 页
													&nbsp;&nbsp; 当前第 <s:property value="blogList.getPage()+1" />
													<s:if test="!blogList.isLastPage()">
														<sx:a id="link4"
															href="page.action?page=next&account=%{user.account }"
															targets="blogLayerLeft">下一页 </sx:a>
														<sx:a id="link2"
															href="page.action?page=last&account=%{user.account }"
															targets="blogLayerLeft">末页 </sx:a>
													</s:if> </span>

											</td>
										</tr>
									</c:if>

								</table>
							</div>
						</td>
						<td valign="top">
							<div id="blogLayerRight">
								<c:if test="${blogUser.account==user.account}">
									<div align="center">
										<a href="/blog/addBlogfore.action"><span>写新日志</span> </a>
									</div>
								</c:if>

								<div id="blogLayerRightList">
									<table style="margin-top: 2px;">
										<tr>
											<td>
												<img src="UploadImages/${user.headImage}" height="100px"
													width="120px" />
											</td>
										<tr>
										<tr>
											<td>
												${user.blogName}的日志：
											</td>

										</tr>
										<tr>
											<td>

												<sx:tree label="普通日志" id="treeList" showRootGrid="true"
													showGrid="true" >
													<s:iterator value="generalList" id="node">
														<sx:treenode label="%{articleTitle}" 
														></sx:treenode>

													</s:iterator>
												</sx:tree>											
												<sx:tree label="语音日志" id="treeVoiceList" showRootGrid="true"
													showGrid="true">
													<s:iterator value="vociceList" id="node">
														<sx:treenode  label="%{articleTitle}" onclick="alert('dfdsf')"></sx:treenode>

													</s:iterator>
												</sx:tree>						
                 
											</td>
										</tr>
									</table>
								</div>
							</div>
						</td>
					</tr>
				</table>


			</div>

		</div>
		<div id="bottom1"><%@include file="bottom.jsp"%></div>
	</body>
</html>

